
### WHAT IS IT ABOUT SACHSENHAUSEN WHEN DV : INTOLERANCE?

# TEST TO SEE IF RANDOM INTERCEPT MODELS REMAIN CONSISTENT WITHOUT SACHSENHAUSEN, OR BERLIN/BRANDENBURG
ri.state.camp.i <- lmer(intolerance~gpc.Distance + gpc.prop_jewish25+gpc.unemployment33+gpc.population25+gpc.nazishare33 + 
                          ( 1 | state) + (1 | closest_camp),evs,
                        control = lmerControl(optimizer ="Nelder_Mead"))
ri.state.camp.i.sh <- lmer(intolerance~gpc.Distance + gpc.prop_jewish25+gpc.unemployment33+gpc.population25+gpc.nazishare33 + 
                             ( 1 | state) + (1 | closest_camp),evs[evs$closest_camp!="Sachsenhausen",],
                           control = lmerControl(optimizer ="Nelder_Mead"))
ri.state.camp.i.b <- lmer(intolerance~gpc.Distance + gpc.prop_jewish25+gpc.unemployment33+gpc.population25+gpc.nazishare33 + 
                            ( 1 | state) + (1 | closest_camp),evs[evs$state!="EAST:\nBerlin" & evs$state!="EAST:\nBrandenburg",],
                          control = lmerControl(optimizer ="Nelder_Mead"))
tab_model(ri.state.camp.i,ri.state.camp.i.sh,ri.state.camp.i.b, 
          show.se=TRUE, show.ci=FALSE, collapse.se=TRUE, show.p=FALSE, p.style="asterisk", p.threshold = c(0.05, 0.01))

# NOW APPLY THESE OMISSIONS TO FIXED EFFECTS MODELS
fe.state.camp.i <- lm(intolerance~Distance + prop_jewish25+unemployment33+population25+nazishare33 + 
                        I(state) + I(closest_camp), data=evs)
fe.state.camp.i.sh <- lm(intolerance~Distance + prop_jewish25+unemployment33+population25+nazishare33 + 
                           I(state) + I(closest_camp), data=evs[evs$closest_camp!="Sachsenhausen",])
fe.state.camp.i.b <- lm(intolerance~Distance + prop_jewish25+unemployment33+population25+nazishare33 + 
                          I(state) + I(closest_camp), evs[evs$state!="EAST:\nBerlin" & evs$state!="EAST:\nBrandenburg",])
tab_model(fe.state.camp.i,fe.state.camp.i.sh,fe.state.camp.i.b, terms=c("Distance","prop_jewish25","unemployment33","population25","nazishare33"),
          show.se=TRUE, show.ci=FALSE, collapse.se=TRUE, show.p=FALSE, p.style="asterisk", p.threshold = c(0.05, 0.01))

### TABLE S5
tab_model(ri.state.camp.i,ri.state.camp.i.sh,ri.state.camp.i.b,fe.state.camp.i,fe.state.camp.i.sh,fe.state.camp.i.b,
          show.se=TRUE, show.ci=FALSE, collapse.se=TRUE, show.p=FALSE, p.style="asterisk", p.threshold = c(0.05, 0.01),
          file="tableS5.html")




### WHAT IS IT ABOUT ARBEITSDORF/DORAMITTLEBAU/BUCHENWALD WHEN DV : RESENTMENT?

# TEST TO SEE IF RANDOM INTERCEPT MODELS REMAIN CONSISTENT WITHOUT CAMPS
ri.state.camp.r <- lmer(resentment~gpc.Distance + gpc.prop_jewish25+gpc.unemployment33+gpc.population25+gpc.nazishare33 + 
                          ( 1 | state) + (1 | closest_camp),evs,
                        control = lmerControl(optimizer ="Nelder_Mead"))
ri.state.camp.r.sh <- lmer(resentment~gpc.Distance + gpc.prop_jewish25+gpc.unemployment33+gpc.population25+gpc.nazishare33 + 
                             ( 1 | state) + (1 | closest_camp),evs[evs$closest_camp!="Sachsenhausen",],
                           control = lmerControl(optimizer ="Nelder_Mead"))
ri.state.camp.r.b <- lmer(resentment~gpc.Distance + gpc.prop_jewish25+gpc.unemployment33+gpc.population25+gpc.nazishare33 + 
                             ( 1 | state) + (1 | closest_camp),evs[evs$state!="EAST:\nBerlin" & evs$state!="EAST:\nBrandenburg",],
                           control = lmerControl(optimizer ="Nelder_Mead"))
tab_model(ri.state.camp.r,ri.state.camp.r.sh,ri.state.camp.r.b, 
          show.se=TRUE, show.ci=FALSE, collapse.se=TRUE, show.p=FALSE, p.style="asterisk", p.threshold = c(0.05, 0.01))

# NOW APPLY THESE OMISSIONS TO FIXED EFFECTS MODELS WITHOUT THEIR STATES
fe.state.camp.r <- lm(resentment~Distance + prop_jewish25+unemployment33+population25+nazishare33 + 
                        I(state) + I(closest_camp), data=evs)
fe.state.camp.r.sh <- lm(resentment~Distance + prop_jewish25+unemployment33+population25+nazishare33 + 
                           I(state) + I(closest_camp), evs[evs$closest_camp!="Sachsenhausen",])
fe.state.camp.r.b <- lm(resentment~Distance + prop_jewish25+unemployment33+population25+nazishare33 + 
                           I(state) + I(closest_camp), evs[evs$state!="EAST:\nBerlin" & evs$state!="EAST:\nBrandenburg",])
tab_model(fe.state.camp.r,fe.state.camp.r.sh,fe.state.camp.r.b, 
          show.se=TRUE, show.ci=FALSE, collapse.se=TRUE, show.p=FALSE, p.style="asterisk", p.threshold = c(0.05, 0.01))

### TABLE S6
tab_model(ri.state.camp.r,ri.state.camp.r.sh,ri.state.camp.r.b,fe.state.camp.r,fe.state.camp.r.sh,fe.state.camp.r.b, 
          show.se=TRUE, show.ci=FALSE, collapse.se=TRUE, show.p=FALSE, p.style="asterisk", p.threshold = c(0.05, 0.01),
          file="tableS6.html")



### WHAT IS IT ABOUT SACHSENHAUSEN WHEN DV : FAR-RIGHT?

# TEST TO SEE IF RANDOM INTERCEPT MODELS REMAIN CONSISTENT WITHOUT SACHSENHAUSEN, OR BERLIN/BRANDENBURG
ri.state.camp.f <- lmer(far_right~gpc.Distance + gpc.prop_jewish25+gpc.unemployment33+gpc.population25+gpc.nazishare33 + 
                          ( 1 | state) + (1 | closest_camp),evs,
                        control = lmerControl(optimizer ="Nelder_Mead"))
ri.state.camp.f.sh <- lmer(far_right~gpc.Distance + gpc.prop_jewish25+gpc.unemployment33+gpc.population25+gpc.nazishare33 + 
                             ( 1 | state) + (1 | closest_camp),evs[evs$closest_camp!="Sachsenhausen",],
                           control = lmerControl(optimizer ="Nelder_Mead"))
ri.state.camp.f.b <- lmer(far_right~gpc.Distance + gpc.prop_jewish25+gpc.unemployment33+gpc.population25+gpc.nazishare33 + 
                            ( 1 | state) + (1 | closest_camp),evs[evs$state!="EAST:\nBerlin" & evs$state!="EAST:\nBrandenburg",],
                          control = lmerControl(optimizer ="Nelder_Mead"))
tab_model(ri.state.camp.f,ri.state.camp.f.sh,ri.state.camp.f.b, 
          show.se=TRUE, show.ci=FALSE, collapse.se=TRUE, show.p=FALSE, p.style="asterisk", p.threshold = c(0.05, 0.01))

# NOW APPLY THESE OMISSIONS TO FIXED EFFECTS MODELS
fe.state.camp.f <- lm(far_right~Distance + prop_jewish25+unemployment33+population25+nazishare33 + 
                        I(state) + I(closest_camp), data=evs)
fe.state.camp.f.sh <- lm(far_right~Distance + prop_jewish25+unemployment33+population25+nazishare33 + 
                           I(state) + I(closest_camp), data=evs[evs$closest_camp!="Sachsenhausen",])
fe.state.camp.f.b <- lm(far_right~Distance + prop_jewish25+unemployment33+population25+nazishare33 + 
                          I(state) + I(closest_camp), evs[evs$state!="EAST:\nBerlin" & evs$state!="EAST:\nBrandenburg",])
tab_model(fe.state.camp.f,fe.state.camp.f.sh,fe.state.camp.f.b, 
          show.se=TRUE, show.ci=FALSE, collapse.se=TRUE, show.p=FALSE, p.style="asterisk", p.threshold = c(0.05, 0.01))

### TABLE S7
tab_model(ri.state.camp.f,ri.state.camp.f.sh,ri.state.camp.f.b,fe.state.camp.f,fe.state.camp.f.sh,fe.state.camp.f.b, 
          show.se=TRUE, show.ci=FALSE, collapse.se=TRUE, show.p=FALSE, p.style="asterisk", p.threshold = c(0.05, 0.01),
          file="tableS7.html")

